/* eslint-disable */
import config from '../../../config';
import styles from '../index.less';
import Util from '../../../utils/Util';
//根据id获取详情拼接数据
export function findOne(data,dutyTreeData,allTreeData,getTreeDataAn ){

    var sonArrListTwo = [
        {
            type: 'TextArea',
            paramName: 'subeventsBasicName',
            id: 'subeventsBasicName',
            title: '0/30',
            num: 30,
            key: "subeventsBasicName",
            label: '子级事件名称',
            placeholder: '请输入事件名称',
            style: { width: 250 },
            rules: [{ ...config.reg.required }],
            span: 10,
            rows: 1,
            shuoming: styles.zishijianmingcheng,
            initialValue: data.ret.object.subeventsBasicName

        },
        {
            type: 'TextArea',
            paramName: 'subeventsBasicWeight',
            id: 'subeventsBasicWeight',
            key: "subeventsBasicWeight",
            label: '子级权重',
            wrapperCol: { span: 12 },
            labelCol: { span: 10 },
            rules: [{ ...config.reg.long3 }],
            span: 6,
            title: '0/4',
            num: 4,
            rows: 1,
            initialValue: data.ret.object.subeventsBasicWeight
        },
        {
            type: 'treeSelect',
            paramName: 'responsibleDepartmentId',
            id: 'responsibleDepartmentId',
            title: '0/200',
            num: 200,
            key: "responsibleDepartmentId",
            label: '子级责任部门',
            rules: [{ ...config.reg.required }],
            treeCheckable: false,
            span: 8,
            rows: 1,
            style: { width: 145 },
            shuoming: styles.zizerenbumen2,
            initialValue: data.ret.object.responsibleDepartmentId,
            treeData: dutyTreeData,
        },
        {
            type: 'TextArea',
            paramName: 'subeventsBasicDescribe',
            id: 'subeventsBasicDescribe',
            title: '0/200',
            num: 200,
            key: "subeventsBasicDescribe",
            label: '子级事件说明',
            placeholder: '请输入事件说明',
            rules: [{ ...config.reg.required }],
            span: 24,
            rows: 2,
            backgroundColor: '#1aaef517',
            shuoming: styles.zishijianshuoming,
            style: { width: 750 },
            initialValue: data.ret.object.subeventsBasicDescribe
        },

        {
            type: 'treeSelect',
            paramName: 'assistanceDepartmentRoles',
            id: 'assistanceDepartmentRoles',
            title: '0/200',
            num: 200,
            key: "assistanceDepartmentRoles",
            label: '子级协助部门',
            rules: [{ ...config.reg.required }],
            treeCheckable: true,
            span: 24,
            rows: 1,
            backgroundColor: '#1aaef517',
            shuoming: styles.zishijianshuoming,
            style: { width: 750 },
            initialValue: data.ret.object.assistanceDepartmentRoleIdList,
            treeData: allTreeData,

        },
        {
            type: 'treeSelect',
            paramName: 'confirmUserRoleId',
            id: 'confirmUserRoleId',
            title: '0/200',
            num: 200,
            key: "confirmUserRoleId",
            label: '子级确认用户',
            rules: [{ ...config.reg.required }],
            treeCheckable: false,
            span: 10,
            shuoming: styles.zishijianmingcheng,
            style: { width: 250 },
            initialValue: data.ret.object.confirmUserRoleId,
            treeData: allTreeData,

        },
        {
            type: 'select',
            paramName: 'sureWay',
            id: 'sureWay',
            key: "sureWay",
            label: '子级确认方式',
            rules: [{ ...config.reg.required }],
            span: 12,
            placeholder: '请选择',
            initialValue: data.ret.object.sureWay == 2 ? '上传文档' : '用户勾选',
            options: [
                { text: '用户勾选', value: '用户勾选' },
                { text: '上传文档', value: '上传文档' },
            ],
            style: { width: 100 },

        },
        {
            type: 'TextArea',
            paramName: 'outcomeDocument',
            id: 'outcomeDocument',
            title: '0/200',
            num: 200,
            key: "outcomeDocument",
            label: '子级成果文件',
            placeholder: '请输入成果文件',
            rules: [{
                required: true,
                message: '必填'
            }],
            span: 24,
            rows: 2,
            shuoming: styles.zishijianshuoming,
            // className:styles.outcomeDocument,
            initialValue: data.ret.object.outcomeDocument,
            style: { width: 750 },
        },
        {
            type: 'treeSelect',
            paramName: 'safetyInformationIdList',
            id: 'safetyInformationIdList',
            title: '0/200',
            num: 200,
            key: "safetyInformationIdList",
            label: '安全提示部门',
            rules: [{ ...config.reg.required }],
            rules: [{ ...config.reg.required }],
            treeCheckable: true,
            span: 12,
            rows: 1,
            backgroundColor: '#1aaef517',
            //   shuoming: styles.zishijianshuoming,
            style: { width: 250 },
            shuoming: styles.zishijianmingcheng,
            initialValue: data.ret.object.safetyInformationIdList,
            treeData: getTreeDataAn
        },
        {
            type: 'TextArea',
            paramName: 'safetyInformation',
            id: 'safetyInformation',
            title: '0/200',
            num: 200,
            key: "safetyInformation",
            label: '安全防护措施',
            placeholder: '请输入防护措施 ',
            rules: [{ ...config.reg.required }],
            span: 24,
            rows: 2,
            backgroundColor: '#1aaef517',
            shuoming: styles.zishijianshuoming,
            initialValue: data.ret.object.safetyInformation,
            style: { width: 750 },
        },

    ]
    if (data.ret.object.hierarchy != 1) {
        sonArrListTwo[1].styleLable = { display: 'none' }
    } else {
        sonArrListTwo[1].styleLable = null
    }

    //上方sonArrList 为基础子级事件模板,下方判断为根据编辑内容显示不同的定制模板
    //说明用户选择上传文档,则会有三种不同的情况看下
    if (data.ret.object.auditWay == 2) {
        //说明为系统内审核
        // console.log(data.ret.object)
        sonArrListTwo.push(
            {
                type: 'select',
                paramName: 'auditWay',
                id: 'auditWay',
                key: "auditWay",
                label: '子级审核方式',
                shuoming: styles.zishijianmingcheng,
                rules: [{ ...config.reg.required }],
                span: 12,
                placeholder: '请选择',
                initialValue: '系统内审核',
                options: [
                    { text: '不需审核', value: '不需审核' },
                    { text: '系统内审核', value: '系统内审核' },
                    { text: '系统内抄送', value: '系统内抄送' },
                    { text: 'OA审批', value: 'OA审批' },

                ],
                style: { width: 250 },
            },
            {
                type: 'treeSelect',
                paramName: 'eventAuditRoleList',
                id: 'eventAuditRoleList',
                title: '0/200',
                num: 200,
                key: "eventAuditRoleList",
                label: '子级审核用户',
                rules: [{ ...config.reg.required }],
                treeCheckable: true,
                span: 24,
                initialValue: data.ret.object.eventAuditRoleIdList,
                style: { width: 750 },
                shuoming: styles.zishijianshuoming,
                treeData: allTreeData,
            },
            {
                type: 'treeSelect',
                paramName: 'eventAuditCCRoleList',
                id: 'eventAuditCCRoleList',
                title: '0/200',
                num: 200,
                key: "eventAuditCCRoleList",
                label: '子级抄送用户',
                treeCheckable: true,
                span: 24,
                shuoming: styles.zishijianshuoming,
                className: styles.outcomeDocument,
                initialValue: data.ret.object.eventAuditCCRoleIdList,
                style: { width: 750 },
                treeData: allTreeData,
            }
        )

    } else if (data.ret.object.auditWay == 3) {
        //系统内抄送
        sonArrListTwo.push(
            {
                type: 'select',
                paramName: 'auditWay',
                id: 'auditWay',
                key: "auditWay",
                label: '子级审核方式',
                shuoming: styles.zishijianmingcheng,
                rules: [{ ...config.reg.required }],
                span: 12,
                placeholder: '请选择',
                initialValue: '系统内抄送',
                style: { width: 250 },
                options: [
                    { text: '不需审核', value: '不需审核' },
                    { text: '系统内审核', value: '系统内审核' },
                    { text: '系统内抄送', value: '系统内抄送' },
                    { text: 'OA审批', value: 'OA审批' },

                ]
            },
            {
                type: 'treeSelect',
                paramName: 'eventAuditCCRoleList',
                id: 'eventAuditCCRoleList',
                title: '0/200',
                num: 200,
                key: "eventAuditCCRoleList",
                label: '子级抄送用户',
                rules: [{ ...config.reg.required }],
                treeCheckable: true,
                span: 24,
                style: { width: 750 },
                initialValue: data.ret.object.eventAuditCCRoleIdList,
                treeData: allTreeData,
            }
        )
    } else if (data.ret.object.auditWay == 4) {
        //OA审批
        sonArrListTwo.push(
            {
                type: 'select',
                paramName: 'auditWay',
                id: 'auditWay',
                key: "auditWay",
                label: '子级审核方式',
                shuoming: styles.zishijianmingcheng,
                rules: [{ ...config.reg.required }],
                span: 12,
                style: { width: 250 },
                placeholder: '请选择',
                initialValue: 'OA审批',
                options: [
                    { text: '不需审核', value: '不需审核' },
                    { text: '系统内审核', value: '系统内审核' },
                    { text: '系统内抄送', value: '系统内抄送' },
                    { text: 'OA审批', value: 'OA审批' },


                ]
            }
        )
    } else if (data.ret.object.auditWay == 1) {
        sonArrListTwo.push(
            {
                type: 'select',
                paramName: 'auditWay',
                id: 'auditWay',
                key: "auditWay",
                label: '子级审核方式',
                shuoming: styles.zishijianmingcheng,
                rules: [{ ...config.reg.required }],
                span: 12,
                placeholder: '请选择',
                initialValue: '不需审核',
                options: [
                    { text: '不需审核', value: '不需审核' },
                    { text: '系统内审核', value: '系统内审核' },
                    { text: '系统内抄送', value: '系统内抄送' },
                    { text: 'OA审批', value: 'OA审批' },
                ],
                style: { width: 250 },
            },
        )
    }
    return sonArrListTwo;
}

export const AllsonArrList = [
    {
        type: 'TextArea',
        paramName: 'subeventsBasicName',
        id: 'subeventsBasicName',
        title: '0/30',
        num: 30,
        key: "subeventsBasicName",
        label: '子级事件名称',
        placeholder: '请输入事件名称',
        style: { width: 250 },
        rules: [{ ...config.reg.required }],
        span: 10,
        rows: 1,
        shuoming: styles.zishijianmingcheng,

    },
    {
        type: 'TextArea',
        paramName: 'subeventsBasicWeight',
        id: 'subeventsBasicWeight',
        key: "subeventsBasicWeight",
        label: '子级权重',
        wrapperCol:{span:12},
        labelCol:{span:10},
        rules: [{ ...config.reg.long3 }],
        title: '0/4',
        num: 4,
        rows: 1,
        span: 6,
        // style: { width: 100 },
    },
    {
        type: 'treeSelect',
        paramName: 'responsibleDepartmentId',
        id: 'responsibleDepartmentId',
        title: '0/200',
        num: 200,
        key: "responsibleDepartmentId",
        label: '子级责任部门',
        rules: [{ ...config.reg.required }],
        treeCheckable: false,
        span: 8,
        rows: 1,
        style: { width: 130 },
        shuoming: styles.zizerenbumen2,
        treeData: []

    },


    {
        type: 'TextArea',
        paramName: 'subeventsBasicDescribe',
        id: 'subeventsBasicDescribe',
        title: '0/200',
        num: 200,
        key: "subeventsBasicDescribe",
        label: '子级事件说明',
        placeholder: '请输入事件说明',
        rules: [{ ...config.reg.required }],
        span: 24,
        rows: 2,
        backgroundColor: '#1aaef517',
        shuoming: styles.zishijianshuoming,
        style: { width: 750 },
    },

    {
        type: 'treeSelect',
        paramName: 'assistanceDepartmentRoles',
        id: 'assistanceDepartmentRoles',
        title: '0/200',
        num: 200,
        key: "assistanceDepartmentRoles",
        label: '子级协助部门',
        rules: [{ ...config.reg.required }],
        treeCheckable: true,
        span: 24,
        rows: 1,
        backgroundColor: '#1aaef517',
        shuoming: styles.zishijianshuoming,
        style: { width: 750 },
        treeData: []

    },
    {
        type: 'treeSelect',
        paramName: 'confirmUserRoleId',
        id: 'confirmUserRoleId',
        title: '0/200',
        num: 200,
        key: "confirmUserRoleId",
        label: '子级确认用户',
        rules: [{ ...config.reg.required }],
        treeCheckable: false,
        span: 10,
        shuoming: styles.zishijianmingcheng,
        backgroundColor: '#1aaef517',
        style: { width: 250 },
        treeData: []

    },
    {
        type: 'select',
        paramName: 'sureWay',
        id: 'sureWay',
        key: "sureWay",
        label: '子级确认方式',
        rules: [{ ...config.reg.required }],
        span: 12,
        placeholder: '请选择',
        style: { width: 100 },
        options: [
            { text: '用户勾选', value: '用户勾选' },
            { text: '上传文档', value: '上传文档' },
        ]
    },
    {
        type: 'TextArea',
        paramName: 'outcomeDocument',
        id: 'outcomeDocument',
        title: '0/200',
        num: 200,
        key: "outcomeDocument",
        label: '子级成果文件',
        placeholder: '请输入成果文件',
        rules: [{
            required: true,
            message: '必填'
        }],
        span: 24,
        rows: 2,
        shuoming: styles.zishijianshuoming,
        backgroundColor: '#1aaef517',
        // className:styles.outcomeDocument,
        style: { width: 750 },
    },
    {
        type: 'treeSelect',
        paramName: 'safetyInformationIdList',
        id: 'safetyInformationIdList',
        title: '0/200',
        num: 200,
        key: "safetyInformationIdList",
        label: '安全提示部门',
        rules: [{ ...config.reg.required }],
        rules: [{ ...config.reg.required }],
        treeCheckable: true,
        span: 12,
        rows: 1,
        backgroundColor: '#1aaef517',
        //   shuoming: styles.zishijianshuoming,
        style: { width: 250 },
        shuoming: styles.zishijianmingcheng,
        treeData: []
    },
    {
        type: 'TextArea',
        paramName: 'safetyInformation',
        id: 'safetyInformation',
        title: '0/200',
        num: 200,
        key: "safetyInformation",
        label: '安全防护措施',
        placeholder: '请输入防护措施',
        rules: [{ ...config.reg.required }],
        span: 24,
        rows: 2,
        backgroundColor: '#1aaef517',
        shuoming: styles.zishijianshuoming,
        style: { width: 750 },
    },
    {
        type: 'select',
        paramName: 'auditWay',
        id: 'auditWay',
        key: "auditWay",
        label: '子级审核方式',
        shuoming: styles.zishijianmingcheng,
        rules: [{ ...config.reg.required }],
        span: 12,
        placeholder: '请选择',
        options: [
            { text: '不需审核', value: '不需审核' },
            { text: '系统内审核', value: '系统内审核' },
            { text: '系统内抄送', value: '系统内抄送' },
            { text: 'OA审批', value: 'OA审批' },


        ],
        backgroundColor: '#1aaef517',
        style: { width: 250 },
    },


];

export const sonArrList =  [
    {
        type: 'TextArea',
        paramName: 'subeventsBasicName',
        id: 'subeventsBasicName',
        title: '0/30',
        num: 30,
        key: "subeventsBasicName",
        label: '子级事件名称',
        placeholder: '请输入事件名称',
        style: { width: 250 },
        rules: [{ ...config.reg.required }],
        span: 10,
        rows: 1,
        shuoming: styles.zishijianmingcheng,
        backgroundColor: '#1aaef517',


    },
    {
        type: 'TextArea',
        paramName: 'subeventsBasicWeight',
        id: 'subeventsBasicWeight',
        key: "subeventsBasicWeight",
        label: '子级权重',
        wrapperCol:{span:12},
        labelCol:{span:10},
        rules: [{ ...config.reg.long3 }],
        span: 6,
        title: '0/4',
        num: 4,
        rows: 1,
        // style: { width: 100 },
    },
    {
        type: 'treeSelect',
        paramName: 'responsibleDepartmentId',
        id: 'responsibleDepartmentId',
        title: '0/200',
        num: 200,
        key: "responsibleDepartmentId",
        label: '子级责任部门',
        rules: [{ ...config.reg.required }],
        treeCheckable: false,
        span: 8,
        rows: 1,
        style: { width: 145 },
        shuoming: styles.zizerenbumen2,
        treeData: [],
        backgroundColor: '#1aaef517',

    },


    {
        type: 'TextArea',
        paramName: 'subeventsBasicDescribe',
        id: 'subeventsBasicDescribe',
        title: '0/200',
        num: 200,
        key: "subeventsBasicDescribe",
        label: '子级事件说明',
        placeholder: '请输入事件说明',
        rules: [{ ...config.reg.required }],
        span: 24,
        rows: 2,
        backgroundColor: '#1aaef517',
        shuoming: styles.zishijianshuoming,
        style: { width: 750 },

    },

    {
        type: 'treeSelect',
        paramName: 'assistanceDepartmentRoles',
        id: 'assistanceDepartmentRoles',
        title: '0/200',
        num: 200,
        key: "assistanceDepartmentRoles",
        label: '子级协助部门',
        rules: [{ ...config.reg.required }],
        treeCheckable: true,
        span: 24,
        rows: 1,
        backgroundColor: '#1aaef517',
        shuoming: styles.zishijianshuoming,
        style: { width: 750 },
        treeData: []

    },
    {
        type: 'treeSelect',
        paramName: 'confirmUserRoleId',
        id: 'confirmUserRoleId',
        title: '0/200',
        num: 200,
        key: "confirmUserRoleId",
        label: '子级确认用户',
        rules: [{ ...config.reg.required }],
        treeCheckable: false,
        span: 10,
        shuoming: styles.zishijianmingcheng,
        backgroundColor: '#1aaef517',
        style: { width: 250 },
        treeData: []

    },
    {
        type: 'select',
        paramName: 'sureWay',
        id: 'sureWay',
        key: "sureWay",
        label: '子级确认方式',
        rules: [{ ...config.reg.required }],
        span: 12,
        placeholder: '请选择',
        style: { width: 100 },
        backgroundColor: '#1aaef517',
        options: [
            { text: '用户勾选', value: '用户勾选' },
            { text: '上传文档', value: '上传文档' },
        ]
    },
    {
        type: 'TextArea',
        paramName: 'outcomeDocument',
        id: 'outcomeDocument',
        title: '0/200',
        num: 200,
        key: "outcomeDocument",
        label: '子级成果文件',
        placeholder: '请输入成果文件',
        rules: [{
            required: true,
            message: '必填'
        }],
        span: 24,
        rows: 2,
        shuoming: styles.zishijianshuoming,
        backgroundColor: '#1aaef517',
        // className:styles.outcomeDocument,
        style: { width: 750 },
    },
    {
        type: 'treeSelect',
        paramName: 'safetyInformationIdList',
        id: 'safetyInformationIdList',
        title: '0/200',
        num: 200,
        key: "safetyInformationIdList",
        label: '安全提示部门',
        rules: [{ ...config.reg.required }],
        rules: [{ ...config.reg.required }],
        treeCheckable: true,
        span: 12,
        rows: 1,
        backgroundColor: '#1aaef517',
        //   shuoming: styles.zishijianshuoming,
        style: { width: 250 },
        shuoming: styles.zishijianmingcheng,
        treeData: []
    },
    {
        type: 'TextArea',
        paramName: 'safetyInformation',
        id: 'safetyInformation',
        title: '0/200',
        num: 200,
        key: "safetyInformation",
        label: '安全防护措施',
        placeholder: '请输入防护措施',
        rules: [{ ...config.reg.required }],
        span: 24,
        rows: 2,
        backgroundColor: '#1aaef517',
        shuoming: styles.zishijianshuoming,
        style: { width: 750 },
    },
    {
        type: 'select',
        paramName: 'auditWay',
        id: 'auditWay',
        key: "auditWay",
        label: '子级审核方式',
        shuoming: styles.zishijianmingcheng,
        rules: [{ ...config.reg.required }],
        span: 12,
        placeholder: '请选择',
        options: [
            { text: '不需审核', value: '不需审核' },
            { text: '系统内审核', value: '系统内审核' },
            { text: '系统内抄送', value: '系统内抄送' },
            { text: 'OA审批', value: 'OA审批' },


        ],
        backgroundColor: '#1aaef517',
        style: { width: 250 },
    },


]